package edu.zhku;

import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.util.Scanner;

// 王明 1376666666 

public class IO_Read_Keybroad {

	public static void main(String[] args){
		while(true)
		{
			String str = new Scanner(System.in).nextLine();
			FileOutputStream fos = null;
			OutputStreamWriter osw = null;
			
			
			try {
				fos = new FileOutputStream("F:\\user.txt",true);
				osw = new OutputStreamWriter(fos);
				osw.write(str + "\r\n");
				osw.flush();
			} catch (Exception e) {
				e.printStackTrace();
			}
			finally{
				try{osw.close();}catch(Exception e){e.printStackTrace();}
				try{fos.close();}catch(Exception e){e.printStackTrace();}	
			}
			
		}
		
		

	}

}
